<!--
 * @Author: ChunLai
 * @Date: 2022-01-27 10:35:48
 * @LastEditTime: 2023-11-16 10:25:07
 * @Description: 现金价值表弹窗
 * @FilePath: \0.newInsure\src\components\cash\CashValueTable.vue
-->
<template>
  <div class="pop-box">
    <div class="pop-main">
      <div class="cash-value-box">
        <ul
          class="table-ul"
          v-for="(item, index) in cashValues"
          :key="`kind-${index}`"
        >
          <li class="flex table-head">
            <span class="flex-aj_cc td-w1 pdtb4 border_l">保单年度</span>
            <span class="flex-aj_cc td-w2 pdtb4">
              《{{ item.proName }}》的基本保险金额对应的现金价值(元)
            </span>
          </li>
          <li
            class="flex table-tr"
            v-for="(cash, idx) in item.tableList"
            :key="`kind${index}-${idx}`"
          >
            <span class="flex-aj_cc td-w1 pdtb4 border_l"
              >第{{ cash.duration }}个保单年度末</span
            >
            <span class="flex-aj_cc td-w2 pdtb4">{{
              cash.sumCVStr || cash.sumCV
            }}</span>
          </li>
        </ul>
      </div>
    </div>
    <div class="pop-btn-box">
      <div class="pop-btn" @click="hasReadIt">我已知悉</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'CashValueTable',
  props: ['cashValues'],
  data() {
    return {};
  },
  components: {},
  computed: {},
  created() {},
  mounted() {},
  watch: {},
  methods: {
    hasReadIt() {
      this.$setMessage('is_read_cash', '1');
      this.$emit('closePop');
    },
  },
};
</script>

<style lang="less" scoped>
.pop-box {
  width: 100vw;
  height: 100vh;
  padding: 14px 14px 0;

  .pop-main {
    width: 100%;
    height: 100%;
    padding-bottom: 40px;
    overflow: hidden;

    .cash-value-box {
      width: 100%;
      height: 100%;
      overflow-y: scroll;

      .table-ul {
        text-align: center;
        border: 1px solid #bababa;
        margin-bottom: 14px;
        border-bottom: none;

        .table-head {
          line-height: 1.5;
          background-color: #e9e9e9;
          border-bottom: 1px solid #bababa;
        }

        .table-tr {
          border-bottom: 1px solid #bababa;
        }
      }
    }
  }
}

.pdtb4 {
  padding: 4px 0;
}

.border_l {
  border-right: 1px solid #bababa;
}

.td-w1 {
  width: 40%;
}

.td-w2 {
  width: 60%;
}

.pop-btn-box {
  position: fixed;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  box-shadow: 0 -0.08rem 0.133333rem 0 rgba(0, 0, 0, 0.1);
  .pop-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40%;
    height: 30px;
    border-radius: 4px;
    letter-spacing: 2px;
    color: #454545;
    background-color: #dddddd;
  }
}
</style>
